package org.eclipse.refactoring;

/**
 * Title:     botton
 * Copyright: Copyright (c) 2011
 * Company:   botton
 * @author    Luiz Botton (lbotton@gmail.com); Netally Santos (snetally@gmail.com>)
 * @version   1
 * Created on 05/2010
 */

import java.util.Map;

import org.eclipse.core.runtime.CoreException;

import org.eclipse.ltk.core.refactoring.Refactoring;
import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;

public class SingletonDescriptor extends RefactoringDescriptor {

	public static final String REFACTORING_ID= "org.eclipse.introduce.indirection";

	private final Map fArguments;

	public SingletonDescriptor(String project, String description, String comment, Map arguments) {
		super(REFACTORING_ID, project, description, comment, RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE);
		fArguments= arguments;
	}

	@Override
	public Refactoring createRefactoring(RefactoringStatus status) throws CoreException {
		SingletonRefactoring refactoring= new SingletonRefactoring();
		status.merge(refactoring.initialize(fArguments));
		return refactoring;
	}

	public Map getArguments() {
		return fArguments;
	}
}